deltas: Use F_DUPFD_CLOEXEC properly
authorDan Nicholson <nicholson@endlessm.com>
Tue, 9 Aug 2016 18:46:30 +0000 (11:46 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 10 Aug 2016 10:54:46 +0000 (10:54 +0000)
You need to supply an argument to F_DUPFD_CLOEXEC or fcntl will return
EINVAL. Use 3 as the minimum fd number as is standard.

Closes: #454
Closes: #448
Approved by: cgwalters

src/libostree/ostree-repo-static-delta-compilation.c

index 7ef7680dc50ec8c6d5e5e3def0144d43bb6f34f1..188f467d49c9236d120f9e025a70e747e3dd6820 100644 (file)
@@ -1362,7 +1362,7 @@ ostree_repo_static_delta_generate (OstreeRepo                   *self,
     }
   else
     {
-      tmp_dfd = fcntl (self->tmp_dir_fd, F_DUPFD_CLOEXEC);
+      tmp_dfd = fcntl (self->tmp_dir_fd, F_DUPFD_CLOEXEC, 3);
       if (tmp_dfd < 0)
         {
           glnx_set_error_from_errno (error);